package cn.hxzy.servlet.admin;

import cn.hxzy.entity.Member;
import cn.hxzy.entity.User;
import cn.hxzy.entity.vo.PageObj;
import cn.hxzy.service.MemberService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/admin/showMember")
public class showMemberServlet extends HttpServlet {
    MemberService memberService=new MemberService();
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        try {
//            PageObj<Member> pageObj = new PageObj<>();
//            String page = req.getParameter("page");
//            String size = req.getParameter("size");
//            if (page != null && page != "") {
//                pageObj.setPage(Integer.parseInt(page));
//            }
//            if (size != null && size != "") {
//                pageObj.setSize(Integer.parseInt(size));
//            }
            List<Member> all = memberService.findAll();
//            "showUser", all
            req.setAttribute("showMember",all);}
        catch (Exception e){
            e.printStackTrace();
        }
        req.getRequestDispatcher("/WEB-INF/jsp/admin/showMember.jsp").forward(req,resp);
    }
}
